package configmap

import (
	"kms-backend/controllers/configmap"

	"github.com/gin-gonic/gin"
)

// 新增
func create(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/create", configmap.Create)
}

// 更新
func update(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/update", configmap.Update)
}

func detail(configmapGroup *gin.RouterGroup) {
	configmapGroup.GET("/detail", configmap.Detail)
}

func list(configmapGroup *gin.RouterGroup) {
	configmapGroup.GET("/list", configmap.List)
}

func delete(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/delete", configmap.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	configmapGroup := g.Group("/configmap")
	create(configmapGroup)
	update(configmapGroup)
	detail(configmapGroup)
	list(configmapGroup)
	delete(configmapGroup)

}
